import Vue from 'vue'
import App from './App.vue'
import './assets/css/tailwindcss.css'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Router from 'vue-router'

axios.defaults.withCredentials = true;
// 全局配置 baseURL前缀
axios.defaults.baseURL = 'http://192.168.1.86:5033';
// axios.defaults.baseURL = 'http://localhost:5033';
// axios.defaults.baseURL = 'http://192.168.110.75:5033';
// 将 axios 挂载到 Vue 原型上，这样在组件中可以通过 this.$axios 访问
Vue.prototype.$axios = axios

import '@fortawesome/fontawesome-free/css/all.css'
import '@fortawesome/fontawesome-free/js/all.js'
import BannerComponent from "@/components/BannerComponent.vue";
import IndexView from "@/views/IndexView.vue";
import FinanceView from "@/views/FinanceView.vue";
import FoodView from "@/views/FoodView.vue";
import LoginView from "@/views/LoginView.vue";
import FoodPickView from "@/components/FoodPickComponent.vue";
import GoalView from "@/views/GoalView.vue";
import TodoView from "@/views/TodoView.vue";
import ChartEdit from "@/views/DashBoardView.vue";
import ProgramView from './views/ProgramView.vue';

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(Router)


const router = new Router({
    routes: [
        {
            path: '/',
            name: 'LoginView',
            component: LoginView,
        },
        {
            path: '/Index',
            name: 'BannerComponent',
            component: BannerComponent,
            children: [
                //   首页，数据归属页。
                {
                    path: 'IndexView',
                    name: 'IndexView',
                    component: IndexView
                },
                // 财务管理界面
                {
                    path: 'FinanceView',
                    name: 'FinanceView',
                    component: FinanceView
                },
                // 饮食管理界面
                {
                    path: 'FoodView',
                    name: 'FoodView',
                    component: FoodView,
                    children: []
                },
                // 饮食选择界面
                {
                    path: 'FoodPickView',
                    name: 'FoodPickView',
                    component: FoodPickView,
                },
                // 目标管理界面
                {
                    path: 'GoalView',
                    name: 'GoalView',
                    component: GoalView,
                },
                // todo管理界面
                {
                    path: 'TodoView',
                    name: 'TodoView',
                    component: TodoView,
                },
                // 项目管理界面
                {
                    path: 'ProgramView',
                    name: 'ProgramView',
                    component: ProgramView,
                },
                // 仪表盘配置界面
                {
                    path: 'DashView',
                    name: 'DashView',
                    component: ChartEdit,
                },
            ]
        }
    ]
})
new Vue({
    router,
    render: h => h(App),
}).$mount('#app')
